package com.itheima.二维数组;

public class Demo01 {
    public static void main(String[] args) {
        int[][] arr = {{10,20,30},{1,2,3,4}};
        /*System.out.println(arr);
        System.out.println(arr[0]);
        System.out.println(arr[1]);*/
        // System.out.println(arr[2]);索引越界

        for (int i = 0; i < arr.length; i++) {
            System.out.print("[");
            for (int j = 0; j < arr[i].length; j++) {
                if (j < arr[i].length - 1) {
                    System.out.print(arr[i][j] + ", ");
                } else {
                    System.out.print(arr[i][j]);
                }
            }
            System.out.println("]");
        }
    }
}
